package hu.bme.gabor.onlab.webapp;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



@SuppressWarnings("serial")
public class RegKey extends HttpServlet {
	                                              
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {

		PrintWriter out = resp.getWriter ();
		
		File f;
		f = new File("myfile.txt");
		if (!f.exists()) {
			f.createNewFile();
			out.println("New file \"myfile.txt\" has been created to the current directory");
			
		}
		
		
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

/*		PrintWriter out = response.getWriter();
		response.setContentType("text/html");

		String token = getToken(email, password);
		String message = request.getParameter("message");

		if (message != null) {
			int resp = sendMessage(token, REGISTRATION_ID, message);
			out.println("http response: "+resp);
		}
		
		out.close();*/
	}
			
}
